﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="CivilleWebRole._Default" %>

<%@ Register Assembly="CivilleWebRole" Namespace="CivilleWebRole" TagPrefix="cc1" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="BodyContent">
    <table width="100%">
        <tr>
            <td>
                <h2>
                    Welcome to Civille!
                </h2>
                <asp:Image src="\Logo\Design\Stakeholders.png" runat="server" />
                <p style="text-align:right">
                    Create your tasks and rewards <a href="http://civillehostedservices.cloudapp.net/AccountsDetails.aspx"
                        title="Get Started >>">Get Started >></a>
                </p>
            </td>
            <td align="center" valign="middle">
                <asp:DropDownList ID="TasksDDL" runat="server" AutoPostBack="true" DataSourceID="TasksDataSource"
                    DataTextField="Title" DataValueField="ID" OnPreRender="GenerateQRCodes" OnTextChanged="GenerateQRCodes"
                    Width="300">
                </asp:DropDownList>
                <asp:SqlDataSource ID="TasksDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CivilleConnectionString %>"
                    SelectCommand="SELECT [Task].[Title], [Task].[ID] FROM [Task], [Stakeholder] WHERE ([Stakeholder].[Name] = @Name AND [Task].[StakeholderID] = [Stakeholder].[ID])">
                    <SelectParameters>
                        <cc1:UserParameter Name="Name" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td align="center" valign="middle">
                &nbsp;
                <asp:UpdatePanel ID="UpdatePanel" runat="server">
                    <ContentTemplate>
                        <asp:Image ID="QRCode" runat="server" ImageUrl="~/QRCodeImage.aspx" OnPreRender="GetQRCode"
                            Height="300" Width="300" />
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="TasksDDL" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</asp:Content>
